/*
 *  Class Token
 *  
 *  Each token is represented by its type and value. 
 */

public class Token {

	// list of tokens
	public static final int EOF = 0;
	public static final int SM = 1;
	public static final int PO = 2;
	public static final int MO = 3;
	public static final int TO = 4;
	public static final int DO = 5;
	public static final int NM = 6;
	public static final int EQ = 7;
	public static final int AO = 8;
	public static final int NE = 9;
	public static final int LO = 10;
	public static final int LA = 11;
	public static final int MD = 12;
	public static final int FA = 13;
	public static final int LB = 14;
	public static final int RB = 15;
	public static final int LP = 16;
	public static final int RP = 17;
	public static final int ERROR = 18;
	public static final int ST = 19;
	public static final int KW = 20;
	public static final int BL = 21;
	public static final int ID = 22;
	private int token; // Type of of token
	private String lexeme; // The lexeme
	private int lineNum;
	private int charNum;

	public Token(int token, String lexeme) {
		this.token = token;
		this.lexeme = lexeme;
		lineNum = Lexer.currLine;
		charNum = Lexer.currChar;
	}

	public int getCharNum() {
		return charNum;
	}

	// Returns the type of the token
	public int getTokenType() {
		return token;
	}

	// Returns the lexeme of the token
	public String getLexeme() {
		return lexeme;
	}

	// Returns a string representation of the token
	public String toString() {
		return token + "\t" + lexeme;
	}

	public Token clone() {
		return null;
	}

	public int getLine() {
		return lineNum;
	}

}